﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ComponentModel;
using System.ServiceModel.Web;

namespace Chinaer.WCF.Contracts
{
    public partial interface IChinaer
    {
        [OperationContract]
        [Description("更新收获地址")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "UpdateAddress",
             Method = "POST"
            )]
        Chinaer.Model.Common.JsonResult UpdateAddress(DTO.AddressDTO addressDTO);

        [OperationContract]
        [Description("删除收获地址")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "DeleteAddress",
             Method = "POST"
            )]
        Chinaer.Model.Common.JsonResult DeleteAddress(DTO.AddressDTO addressDTO);

        [OperationContract]
        [Description("添加收获地址")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "AddAddress",
             Method = "POST"
            )]
        Chinaer.Model.Common.JsonResult AddAddress(DTO.AddressDTO addressDTO);

        [OperationContract]
        [Description("根据收获地址编号删除收获地址")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "DeleteAddressByAddressID/{addressID}/{apiToken}",
             Method = "GET"
            )]
        Chinaer.Model.Common.JsonResult DeleteAddressByAddressID(string addressID, string apiToken);

        [OperationContract]
        [Description("根据顾客编号查询顾客所有的收获地址")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "GetAddressByCustomerID/{customerID}/{apiToken}",
             Method = "GET"
            )]
        List<DTO.AddressDTO> GetAddressByCustomerID(string customerID,string apiToken);

        [OperationContract]
        [Description("根据收获地址编号获取收获地址的详细信息")]
        [WebInvoke(
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Bare,
             UriTemplate = "GetAddressByAddressID/{addressID}/{apiToken}",
             Method = "GET"
            )]
        DTO.AddressDTO GetAddressByAddressID(string addressID,string apiToken);


    }
}
